<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
      xmlns:mo="https://gitee.com/aun/Timo">
<head th:replace="/common/template :: header(~{::title},~{::link},~{::style})">
    <link rel="stylesheet" th:href="@{/lib/zTree_v3/css/zTreeStyle/zTreeStyle.css}" type="text/css">
</head>
<body>
<div class="layui-form timo-compile">
    <form th:action="@{/mains/address/save}">
        <input type="hidden" name="id" th:if="${userAddress}" th:value="${userAddress.id}"/>
        <div class="layui-form-item">
            <label class="layui-form-label required">用户名</label>
            <div class="layui-input-inline">
                <input class="layui-input" type="text" name="username"  placeholder="请输入用户名" th:value="${userAddress?.username}">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label required">省</label>
            <div class="layui-input-inline">
                <input class="layui-input" type="text" name="province" placeholder="请输入省" th:value="${userAddress?.province}">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label required">市</label>
            <div class="layui-input-inline">
                <input class="layui-input" type="text" name="city" placeholder="请输入市" th:value="${userAddress?.city}">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label required">县</label>
            <div class="layui-input-inline">
                <input class="layui-input" type="text" name="town" placeholder="请输入县" th:value="${userAddress?.town}">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label required">详细地址</label>
            <div class="layui-input-inline">
                <input class="layui-input" type="text" name="others" placeholder="请输入详细地址" th:value="${userAddress?.others}">
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label required">电话</label>
            <div class="layui-input-inline">
                <input class="layui-input" type="text" name="mobile" placeholder="请输入电话" th:value="${userAddress?.mobile}">
            </div>
        </div>

        <div class="layui-form-item layui-form-text">
            <label class="layui-form-label">备注</label>
            <div class="layui-input-block">
                <textarea placeholder="请输入内容" class="layui-textarea" name="remark">[[${userAddress?.remark}]]</textarea>
            </div>
        </div>
        <div class="layui-form-item timo-finally">
            <button class="layui-btn ajax-submit"><i class="fa fa-check-circle"></i> 保存</button>
            <button class="layui-btn btn-secondary close-popup"><i class="fa fa-times-circle"></i> 关闭</button>
        </div>
    </form>
</div>
<script th:replace="/common/template :: script"></script>
<script type="text/javascript" th:src="@{/js/plugins/jquery-3.3.1.min.js}"></script>
<script type="text/javascript" th:src="@{/lib/zTree_v3/js/jquery.ztree.core.min.js}"></script>
<script type="text/javascript" th:src="@{/js/timoTree.js}"></script>
<script type="text/javascript">
    // 树形菜单
    $.fn.selectTree();
</script>
</body>
</html>